<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="net.sureon.dao.*"%>
<%@page import="net.sureon.common.DateFormat"%>
<%@page import="net.sureon.common.I18nSupport"%>
<%
	List<Application> all = null;
	all = (List<Application>)request.getAttribute("all");
 %>
 <%
int currentPage = (Integer)request.getAttribute("currentPage");
int pageCounter = (Integer)request.getAttribute("pageCounter");
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0055)http://www.sureon.net/WebPage/UnderlingApplication.aspx -->
<HTML xmlns="http://www.w3.org/1999/xhtml">
	<HEAD>
		<TITLE>下属的申请</TITLE>
		<META http-equiv=Content-Type content="text/html; charset=utf-8">
		<META content="MSHTML 6.00.5730.13" name=GENERATOR>
	</HEAD>
	<BODY>

		<jsp:include page="../header.jsp"></jsp:include>
			<DIV>
				<TABLE class=style1 cellSpacing=0 cellPadding=0>
					<TBODY>
						<TR>
							<TD colSpan=2>
								<TABLE class=style5 cellSpacing=0 cellPadding=0>
									<TBODY>
										<TR>
											<TD class=style6 style="TEXT-ALIGN: left" bgColor=#fffbd6>
												<TABLE class=ctl00_ContentPlaceHolder1_Menu1_2
													id=ctl00_ContentPlaceHolder1_Menu1 cellSpacing=0
													cellPadding=0 border=0>
													<TBODY>
														<TR>
															<TD id=ctl00_ContentPlaceHolder1_Menu1n0
																onkeyup=Menu_Key(this)
																onmouseover=Menu_HoverStatic(this)
																onmouseout=Menu_Unhover(this)>
																<TABLE
																	class="ctl00_ContentPlaceHolder1_Menu1_4 ctl00_ContentPlaceHolder1_Menu1_9"
																	cellSpacing=0 cellPadding=0 width="100%" border=0>
																	<TBODY>
																		<TR>
																			<TD style="WHITE-SPACE: nowrap">
																				<A
																					class="ctl00_ContentPlaceHolder1_Menu1_1 ctl00_ContentPlaceHolder1_Menu1_3 ctl00_ContentPlaceHolder1_Menu1_8"
																					href="<%=request.getContextPath() + "/user/underlingApplication.do" %>">待审批的申请</A>
																			</TD>
																		</TR>
																	</TBODY>
																</TABLE>
															</TD>
															<TD style="WIDTH: 3px"></TD>
															<TD id=ctl00_ContentPlaceHolder1_Menu1n1
																onkeyup=Menu_Key(this)
																onmouseover=Menu_HoverStatic(this)
																onmouseout=Menu_Unhover(this)>
																<TABLE class=ctl00_ContentPlaceHolder1_Menu1_4
																	cellSpacing=0 cellPadding=0 width="100%" border=0>
																	<TBODY>
																		<TR>
																			<TD style="WHITE-SPACE: nowrap">
																				<A
																					class="ctl00_ContentPlaceHolder1_Menu1_1 ctl00_ContentPlaceHolder1_Menu1_3"
																					href="<%=request.getContextPath() + "/user/underlingReviewApplication.do" %>">已审批的申请</A>
																			</TD>
																		</TR>
																	</TBODY>
																</TABLE>
															</TD>
														</TR>
													</TBODY>
												</TABLE>
											</TD>
										</TR>
										<TR>
											<TD class=style6 style="TEXT-ALIGN: left">
												<TABLE class=style5 cellSpacing=0 cellPadding=0>
													<TBODY>
														<TR>
															<TD style="TEXT-ALIGN: left">
																<DIV>
																	<TABLE id=ctl00_ContentPlaceHolder1_GridView2
																		style="FONT-SIZE: small; WIDTH: 100%; COLOR: #333333; FONT-FAMILY: Arial; BORDER-COLLAPSE: collapse"
																		cellSpacing=0 cellPadding=4 border=0>
																		<TBODY>
																			<TR
																				style="FONT-WEIGHT: bold; COLOR: white; BACKGROUND-COLOR: #507cd1"
																				align=middle>
																				<TH scope=col style="COLOR: white">
																					姓名
																				</TH>
																				<TH scope=col style="COLOR: white">
																					申请类别
																				</TH>
																				<TH scope=col style="COLOR: white">
																					开始日期
																				</TH>
																				<TH scope=col style="COLOR: white">
																					结束日期
																				</TH>
																				<TH scope=col style="COLOR: white">
																					累计时长
																				</TH>
																				<TH scope=col style="COLOR: white">
																					说明
																				</TH>
																				<TH scope=col style="COLOR: white">
																					提交时间
																				</TH>
																				<TH scope=col colspan="2" style="COLOR: white">
																					&nbsp;&nbsp;
																				</TH>
																			</TR>
																			
																			<%
																				if(all == null || all.size() == 0) {
																			%>
																			<%	
																				} else {
																					String bgColor=null;
																					String color_a = "#FFFFFF";
																					String color_b = "#EFF3FB";														
																					for (int i = 0; i < all.size(); i++) {
																						bgColor = (i%2 == 0)?color_a:color_b;
																						Application app = all.get(i);
																				
																			 %>
																			
																			<TR style="BACKGROUND-COLOR: <%=bgColor%>" align=middle>
																				<TD style="WIDTH: 75px">
																				<a href="<%=request.getContextPath() %>/user/underlingApplication.do?showContent=true&applicationID=<%=app.getApplicationID() %>">
																				<%=app.getAuthor().getRealName() %>
																				</a>
																				</TD>
																				<TD style="WIDTH: 60px">
																					<%=I18nSupport.getMessage(app.getCategory()) %>
																				</TD>
																				<TD style="WIDTH: 75px">
																					<%=app.getStartDate() %>
																				</TD>
																				<TD style="WIDTH: 75px">
																					<%=app.getEndDate() %>
																				</TD>
																				<TD style="WIDTH: 60px">
																					<%=app.getSumTime() %>
																				</TD>
																				<TD>
																					<%
																						String note = app.getNote();
																						if(note.length() > 73){
																							note = note.substring(0, 70);
																							note = note + "...";
																						}
																						out.print(note);
																						
																					 %>
																				</TD>
																				<TD style="WIDTH: 75px">
																					<%=DateFormat.formatToDetail(app.getSubmitDate()) %>
																				</TD>
																				<td style="WIDTH: 40px">
																					<a href="<%=request.getContextPath() %>/user/confirmApplication.do?applicationID=<%=app.getApplicationID() %>">批准</a>
																				</td>
																				<td style="WIDTH: 30px">
																					<a href="<%=request.getContextPath() %>/user/nonConfirmApplication.do?applicationID=<%=app.getApplicationID() %>">驳回</a>
																				</td>
																			</TR>
																		<%
																			}
																				}
																		 %>
																		</TBODY>
																	</TABLE>
																</DIV>
															</TD>
														</TR>
													</TBODY>
												</TABLE>
											</TD>
										</TR>
										
										<TR>
											<TD style="TEXT-ALIGN: center">
												<jsp:include page="../splitPage.jsp">
												<jsp:param name="url" value="/user/underlingApplication.do"/>
												<jsp:param name="currentPage" value="<%=currentPage %>"/>
												<jsp:param name="pageCounter" value="<%=pageCounter %>"/>
												</jsp:include>
											</TD>
										</TR>									
										
										
										<FORM id=aspnetForm name=aspnetForm
								action="<%=request.getContextPath()%>/user/underlingApplication.do"
								method=post>
								
									<TR>
										<TD>
											<DIV id=ctl00_ContentPlaceHolder1_Panel1>
												<TABLE class=style5 cellSpacing=0 cellPadding=0 width="689"
													height="90">
													<TBODY>
														<%
															Application app = (Application)request.getAttribute("application");
															if(app != null) {
															
														 %>
													 <TR>
															<TD style="TEXT-ALIGN: left">
																<SPAN id=ctl00_ContentPlaceHolder1_Label4
																	style="FONT-SIZE: small">申请类别：</SPAN>
																	<SELECT
																			id=ctl00_ContentPlaceHolder1_DropDownList1
																			style="HEIGHT: 20px" name="category">
																														
																			<OPTION value="Over" <%="Over".equals(app.getCategory()) ? "selected" : "" %>>
																					加班
																			</OPTION>
																			<OPTION value="Vocation" <%="Vocation".equals(app.getCategory()) ? "selected" : "" %>>
																				休假
																			</OPTION>
																			<OPTION value="Leave" <%="Leave".equals(app.getCategory()) ? "selected" : "" %>>
																				请假
																			</OPTION>
																			<OPTION value="BusinessTrip" <%="BusinessTrip".equals(app.getCategory()) ? "selected" : "" %>>
																				出差
																			</OPTION>
																													
																	</SELECT>
															</TD>
															<TD style="TEXT-ALIGN: left">
																<SPAN id="xxxxxxxx" style="FONT-SIZE: small">开始日期：</SPAN>
																<INPUT id="startDate"
																	style="FONT-SIZE: small; WIDTH: 86px; HEIGHT: 16px"
																	value="<%=new java.text.SimpleDateFormat("yyyy-MM-dd").format(app.getStartDate())%>"
																	name="startDate">
															</TD>
															<TD style="TEXT-ALIGN: left">
																<SPAN id="yyyyy" style="FONT-SIZE: small">结束日期：</SPAN>
																<INPUT id="endDate"
																	style="FONT-SIZE: small; WIDTH: 86px; HEIGHT: 16px"
																	value="<%=new java.text.SimpleDateFormat("yyyy-MM-dd").format(app.getEndDate())%>"
																	name="endDate">
															</TD>
															<TD style="TEXT-ALIGN: right">
																<SPAN id=ctl00_ContentPlaceHolder1_Label7
																	style="FONT-SIZE: small">累计时长：</SPAN>
																<INPUT id=ctl00_ContentPlaceHolder1_TextBox3
																	style="FONT-SIZE: small; WIDTH: 30px; HEIGHT: 16px"
																	value=<%=app.getSumTime() %> name=sumTime>
																<SPAN id=ctl00_ContentPlaceHolder1_Label8
																	style="FONT-SIZE: small">小时</SPAN>
															</TD>
														</TR>
														<TR>
															<TD colSpan=4>
																<TEXTAREA id=ctl00_ContentPlaceHolder1_TextBox4
																	style="FONT-SIZE: small; WIDTH: 99.5%; HEIGHT: 80px"
																	name="note"><%=app.getNote() %></TEXTAREA>
															</TD>
														</TR>
													 
													 <%
													 	}
													  %>
												   <%-- 
														<TR>
															<input type="hidden" name="status" value="Pending" />
															<TD style="TEXT-ALIGN: center" colSpan=4>
																<INPUT id=ctl00_ContentPlaceHolder1_Button1 type=submit
																	value="提 交" name=ctl00$ContentPlaceHolder1$Button1
																	onclick="return checkDate();">
															</TD>
														</TR>
													--%>
										</FORM>
										
									</TBODY>
								</TABLE>
							</TD>
						</TR>
					</TBODY>
				</TABLE>
			</DIV>
			<jsp:include page="../footer.jsp"></jsp:include>
	</BODY>
</HTML>
